import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:nyh_motorcade_app/styles/colors.dart';
import 'package:nyh_motorcade_app/widgets/custom_app_bar.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'payment_result_controller.dart';

class PaymentResultPage extends StatelessWidget {
  final controller = Get.put(PaymentResultController());

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colours.color_background,
      appBar: CustomAppBar(context: context, title: "支付结果"),
      body: Stack(
        fit: StackFit.expand,
        alignment: AlignmentDirectional.center,
        children: [
          Positioned(
            top: 105.w,
            child: Column(
              children: [
                Image.asset(
                  "images/ic_payment_success.png",
                  fit: BoxFit.cover,
                  width: 80.w,
                  height: 80.w,
                ),
                SizedBox(
                  height: 16.w,
                ),
                Text(
                  "支付成功",
                  style: TextStyle(
                    color: Colours.color_text_theme,
                    fontSize: 16.sp,
                  ),
                ),
              ],
            ),
          ),
          Positioned(
            bottom: 116.w,
            child: Row(
              children: [
                TextButton(
                  onPressed: () {
                    controller.goPage();
                  },
                  child: Text(
                    "查看详情",
                    style: TextStyle(
                      color: Colours.color_6f7082,
                      fontSize: 14.sp,
                    ),
                  ),
                  style: ButtonStyle(
                    backgroundColor: MaterialStateProperty.all(Colours.color_background),
                    shape: MaterialStateProperty.all(
                      RoundedRectangleBorder(
                        borderRadius: BorderRadius.circular(6.w),
                        side: BorderSide(width: 1.w, color: Colours.color_e2e2d5),
                      ),
                    ),
                    minimumSize: MaterialStateProperty.all(Size(80.w, 30.w)),
                  ),
                ),
                SizedBox(
                  width: 16.w,
                ),
                TextButton(
                  onPressed: () {
                    Get.back(result: {});
                  },
                  child: Text(
                    "返回首页",
                    style: TextStyle(
                      color: Colours.color_theme,
                      fontSize: 14.sp,
                    ),
                  ),
                  style: ButtonStyle(
                    backgroundColor: MaterialStateProperty.all(Colours.color_background),
                    shape: MaterialStateProperty.all(
                      RoundedRectangleBorder(
                        borderRadius: BorderRadius.circular(6.w),
                        side: BorderSide(width: 1.w, color: Colours.color_theme),
                      ),
                    ),
                    minimumSize: MaterialStateProperty.all(Size(80.w, 30.w)),
                  ),
                ),
              ],
            ),
          ),
        ],
      ),
    );
  }
}
